/**
 * Created by PanJiaChen on 16/11/18.
 */

/**
 * @param {string} path
 * @returns {Boolean}
 */
export function isExternal(path) {
  return /^(https?:|mailto:|tel:)/.test(path)
}

/**
 * @param {string} str
 * @returns {Boolean}
 */
export function validUsername(str) {
  const valid_map = ['admin', 'editor']
  return true
}

export function validatePassword (rule, value, callback){
  if (value === '') {
    callback(new Error('请输入密码'));
  } else {
    callback();
  }
}
export function validateContent (rule, value, callback){
  if (value === '') {
    callback(new Error('请输入内容'));
  } else {
    
    callback();
  }
}